var backBtn = null;
var LocString = String(window.document.location.href);
function GetQueryString(name) {
	var rs = new RegExp("(^|)" + name + "=([^&]*)(&|$)", "gi").exec(LocString), tmp;
	if (tmp = rs) {
		return decodeURI(tmp[2]);
	}
	// parameter cannot be found
	return "";
}

$(function(){

	var	proCode = $("#proCode");
	var	proName = $("#proName");
	var	proContact = $("#proContact");
	var	proPhone = $("#proPhone");
	var	proFax = $("#proFax");
	var	proDesc = $("#proDesc");

	$.get("Provider/"+GetQueryString("providerId"),function (data) {
		if (data.code===200){
			var provider = data.data;
			proCode.html(provider.proCode)
			proName.html(provider.proName)
			proContact.html(provider.proContact)
			proPhone.html(provider.proPhone)
			proFax.html(provider.proFax)
			proDesc.html(provider.proDesc)
		}else {
			alert("查看出问题了1")
		}
	})


	backBtn = $("#back");
	backBtn.on("click",function(){
		//alert("view : "+referer);
		if(referer != undefined 
			&& null != referer 
			&& "" != referer
			&& "null" != referer
			&& referer.length > 4){
		 window.location.href = referer;
		}else{
			history.back(-1);
		}
	});
});